/*
 * @Author: wy
 * @Date: 2021-02-04 15:19:49
 * @LastEditTime: 2021-10-25 16:06:07
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \radio-web\src\views\radio\clip\clipColumns\AItranslateColumns.js
 */
import {
  audioStatusFormat,
  clipStatusFormat,
  inStockStatusFormat,
  lenTypeFormat
} from '../../../../mixin/MixinContants'
import TimeUtil from './../../../../utils/time-util'
// 素材列表
export const materialColumn = [
  {
    label: 'id',
    prop: 'id',
    align: 'center'
  },
  {
    label: '封面',
    prop: 'posterUrl',
    align: 'center',
    render: (h, row) => {
      return (<img style='width:100%;height:100%;' src={row.posterUrl}/>)
    }
  },
  {
    label: '素材名称',
    prop: 'title',
    align: 'center'
  },
  {
    label: '一级标签',
    prop: 'cateOneText',
    align: 'center'
  },
  {
    label: '二级标签',
    prop: 'cateTwoText',
    align: 'center'
  },
  {
    label: '总时长',
    prop: 'length',
    align: 'center',
    render: (h, row) => {
      return (<span>{ TimeUtil.secondsToTime(row['length']) }</span>)
    }
  },
  {
    label: '剪辑状态',
    prop: 'status',
    align: 'center',
    render: (h, row) => {
      return (<span>{clipStatusFormat.data[row.status].value}</span>)
    }
  },
  {
    label: '审核状态',
    prop: 'inStock',
    align: 'center',
    render: (h, row) => {
      return (<span>{audioStatusFormat.data[row.inStock].value}</span>)
    }
  },
  {
    label: '入库状态',
    prop: 'inStock',
    align: 'center',
    render: (h, row) => {
      return (<span>{inStockStatusFormat.data[row.inStock].value}</span>)
    }
  },
  {
    label: '未通过原因',
    prop: 'auditMsg',
    align: 'center',
    render: (h, row) => {
      return (<span style={{ 'color': row.inStock == 2 ? 'red' : '' }}>{ row.inStock == 2 ? row.auditMsg : '-' }</span>)
    }
  },
  {
    label: '节目分类',
    prop: 'lenType',
    align: 'center',
    render: (h, row) => {
      return (<span>{lenTypeFormat.data[row.lenType].value}</span>)
    }
  },
  {
    label: '创建时间',
    prop: 'addTime',
    align: 'center'
  }

]
// 合辑列表
export const collectColumn = [
  {
    label: '合辑ID',
    prop: 'id',
    align: 'center'
  },
  {
    label: '一级标签',
    prop: 'cateOneText',
    align: 'center'
  },
  {
    label: '二级标签',
    prop: 'cateTwoText',
    align: 'center'
  },
  {
    label: '审核状态',
    prop: 'inStock',
    align: 'center',
    render: (h, row) => {
      return (<span>{audioStatusFormat.data[row.inStock].value}</span>)
    }
  },
  {
    label: '入库状态',
    prop: 'inStock',
    align: 'center',
    render: (h, row) => {
      return (<span>{inStockStatusFormat.data[row.inStock].value}</span>)
    }
  },
  {
    label: '未通过原因',
    prop: 'auditMsg',
    align: 'center',
    render: (h, row) => {
      return (<span style={{ 'color': row.inStock === 2 ? 'red' : '' }}>{ row.inStock === 2 ? row.auditMsg : '-' }</span>)
    }
  },
  {
    label: '创建时间',
    prop: 'addTime',
    align: 'center'
  }
]
// 合辑详情列表
export const collectDetailColumn = [
  {
    label: 'ID',
    prop: 'id',
    align: 'center'
  },
  {
    label: '合辑信息',
    prop: 'colNo',
    align: 'center'
  },
  {
    label: '封面',
    prop: 'posterUrl',
    align: 'center',
    render: (h, row) => {
      return (<img style='width:100%;height:100%;' src={row.posterUrl}/>)
    }
  },
  {
    label: '素材名称',
    prop: 'title',
    align: 'center'
  },
  {
    label: '一级标签',
    prop: 'cateOneText',
    align: 'center'
  },
  {
    label: '二级标签',
    prop: 'cateTwoText',
    align: 'center'
  },
  {
    label: '关键字',
    prop: 'keywords',
    align: 'center'
  },
  {
    label: '视频时长',
    prop: 'keywords',
    align: 'center',
    formatter(row, column, cellValue, index) {
      return `<div>${TimeUtil.secondsToTime(row['length'])}</div>`
    }
  },
  {
    label: '审核状态',
    prop: 'inStock',
    align: 'center',
    render: (h, row) => {
      return (<span>{audioStatusFormat.data[row.inStock].value}</span>)
    }
  },
  {
    label: '入库状态',
    prop: 'inStock',
    align: 'center',
    render: (h, row) => {
      return (<span>{inStockStatusFormat.data[row.inStock].value}</span>)
    }
  },
  {
    label: '创建时间',
    prop: 'addTime',
    align: 'center'
  }
]
